﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EBEInventory_DAL;
public partial class Inventory_Loc_SubLoc_Mangement_Default : System.Web.UI.Page
{
    InventoryEntities ctx = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        InventoryEntities ctx = InitConnection.Initialize();
        if (!Page.IsPostBack)
        {
            dropDown_InvID.DataSource = InvOps.GetInvNames(ctx);
            Page.DataBind();
        }
    }
    protected void btn_SubLocRegister_Click(object sender, EventArgs e)
    {
        Dictionary<string, string> sub = new Dictionary<string, string>();
        sub["InvID"] = dropDown_InvID.SelectedValue;
        sub["ID"] = txt_SubLocID.Text;
        sub["Name"] = txt_SubLocName.Text;
        sub["Notes"] = txt_SubLocNote.Text;

        SubInvOps.AddSubInventory(sub, ctx);
        Response.Redirect("~/Inventory/Loc-SubLoc Mangement/ListLoc-Sub.aspx");
    }
}